package com.triadsystems.cashweb.modelo.persistencia.entidades;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;

@Entity
@Table
@SequenceGenerator(name="seq_transacao_pagamento", sequenceName="cw_seq_transacao_pagamento", initialValue = 1, allocationSize = 1)
public class TransacaoPagamento extends ValueObject{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -6025136565088198309L;

	@Id
	@Column
	@GeneratedValue(generator = "seq_transacao_pagamento", strategy = GenerationType.SEQUENCE)
	@Getter @Setter
	private Long entityId;
	
	@Getter @Setter
	private Integer codigoTransacao;
	
	@Getter @Setter
	private String numeroCupomFiscal;

	@Getter @Setter
	@ManyToOne(targetEntity = Movimentacao.class, cascade = CascadeType.ALL)
	private Movimentacao movimentacao;
	
//	@Getter @Setter
//	@OneToMany(targetEntity = Pagamento.class, mappedBy="codTransacao", cascade = CascadeType.ALL, fetch=FetchType.EAGER)
//	private Set<Pagamento> pagamentos = new HashSet<Pagamento>();	
}
